package com.lx.es.query.test.entity;

import cn.lx.es.query.annotation.ESID;
import cn.lx.es.query.annotation.ESMetaData;
import cn.lx.es.query.annotation.ESMapping;
import cn.lx.es.query.annotation.MatchSearch;
import cn.lx.es.query.annotation.TermSearch;
import cn.lx.es.query.annotation.TermsSearch;
import cn.lx.es.query.annotation.RangeSearch;
import cn.lx.es.query.annotation.FuzzySearch;
import cn.lx.es.query.annotation.WildcardSearch;
import cn.lx.es.query.annotation.PrefixSearch;
import cn.lx.es.query.enums.DataType;
import cn.lx.es.query.enums.Analyzer;
import cn.lx.es.query.search.entity.PageSortHighLight;
import cn.lx.es.query.search.entity.Range;
import com.lx.es.query.test.annotation.NotInSearch;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 基础数据药品信息（包含黑名单标志）
 * 改造为支持动态ES查询的搜索DTO
 *
 * @author gaoyy
 * @date 2020/4/26 17:34
 */
@ESMetaData(indexName = "bdc-drug-info",printLog = true)
public class BidprcuDrugInfoSearchDTO extends PageSortHighLight {

    /**
     * 药品信息id
     */
    @ESID
    @ESMapping(datatype = DataType.LONG)
    private Long drugInfoId;

    /**
     * 药品代码 - 精确匹配，支持前缀查询
     */
    @TermSearch
    @PrefixSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String drugCode;

    /**
     * 药品名称 - 分词匹配，支持模糊查询
     */
    @NotInSearch
    @ESMapping(datatype = DataType.TEXT, analyzer = Analyzer.ik_max_word, searchAnalyzer = Analyzer.ik_max_word)
    private String drugName;

    /**
     * 通用名代码 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String gennameCode;

    /**
     * 通用名称 - 分词匹配
     */
    @MatchSearch
    @ESMapping(datatype = DataType.TEXT, analyzer = Analyzer.ik_max_word, searchAnalyzer = Analyzer.ik_max_word)
    private String genname;

    /**
     * 剂型名称 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String dosformName;

    /**
     * 给药途径代码 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String ruteCode;

    /**
     * 给药途径名称 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String ruteName;

    /**
     * 药理分类代码1 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String phamTypeCode1;

    /**
     * 药理分类代码2 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String phamTypeCode2;

    /**
     * 药理分类代码3 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String phamTypeCode3;

    /**
     * 药理分类代码4 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String phamTypeCode4;

    /**
     * 药理分类名称1 - 多值匹配
     */
    @TermsSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String phamTypeName1;

    /**
     * 药理分类名称2 - 多值匹配
     */
    @TermsSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String phamTypeName2;

    /**
     * 药理分类名称3 - 多值匹配
     */
    @TermsSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String phamTypeName3;

    /**
     * 药理分类名称4 - 多值匹配
     */
    @TermsSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String phamTypeName4;

    /**
     * 规格名称 - 分词匹配
     */
    @MatchSearch
    @ESMapping(datatype = DataType.TEXT, analyzer = Analyzer.ik_max_word, searchAnalyzer = Analyzer.ik_max_word)
    private String specName;

    /**
     * 生产企业代码 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String prodentpCode;

    /**
     * 生产企业名称 - 分词匹配
     */
    @MatchSearch
    @ESMapping(datatype = DataType.TEXT, analyzer = Analyzer.ik_max_word, searchAnalyzer = Analyzer.ik_max_word)
    private String prodentpName;

    /**
     * 代理企业代码 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String prxyEntpCode;

    /**
     * 代理企业名称 - 分词匹配
     */
    @MatchSearch
    @ESMapping(datatype = DataType.TEXT, analyzer = Analyzer.ik_max_word, searchAnalyzer = Analyzer.ik_max_word)
    private String prxyEntpName;

    /**
     * 包装（转换比+最小使用单位/最小包装单位） - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String pac;

    /**
     * 包装材质名称 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String pacmatlName;

    /**
     * 产品类型名称 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String prodTypeName;

    /**
     * 产品来源代码，参考字典表prod_souc - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String prodSoucCode;

    /**
     * 产品来源名称 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String prodSoucName;

    /**
     * 批准文号 - 精确匹配，支持通配符查询
     */
    @TermSearch
    @WildcardSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String aprvno;

    /**
     * 注册证号 - 精确匹配，支持通配符查询
     */
    @TermSearch
    @WildcardSearch
    @ESMapping(datatype = DataType.KEYWORD, analyzer = Analyzer.standard)
    private String regcertno;

    /**
     * 日均使用量 - 范围查询
     */
    @RangeSearch
    @ESMapping(datatype = DataType.DOUBLE)
    private BigDecimal dayuse;

    /**
     * 基药标志 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String essdrugFlag;

    /**
     * 经办时间 - 范围查询
     */
    @ESMapping(datatype = DataType.DATE)
    private Date optTime;

    /**
     * 黑名单标志 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String bklsFlag;

    /**
     * 医保标志 - 精确匹配
     */
    @TermSearch
    @ESMapping(datatype = DataType.KEYWORD)
    private String hiType;

    // getter和setter方法
    public Long getDrugInfoId() {
        return drugInfoId;
    }

    public void setDrugInfoId(Long drugInfoId) {
        this.drugInfoId = drugInfoId;
    }

    public String getDrugCode() {
        return drugCode;
    }

    public void setDrugCode(String drugCode) {
        this.drugCode = drugCode;
    }

    public String getDrugName() {
        return drugName;
    }

    public void setDrugName(String drugName) {
        this.drugName = drugName;
    }

    public String getGennameCode() {
        return gennameCode;
    }

    public void setGennameCode(String gennameCode) {
        this.gennameCode = gennameCode;
    }

    public String getGenname() {
        return genname;
    }

    public void setGenname(String genname) {
        this.genname = genname;
    }

    public String getDosformName() {
        return dosformName;
    }

    public void setDosformName(String dosformName) {
        this.dosformName = dosformName;
    }

    public String getRuteCode() {
        return ruteCode;
    }

    public void setRuteCode(String ruteCode) {
        this.ruteCode = ruteCode;
    }

    public String getRuteName() {
        return ruteName;
    }

    public void setRuteName(String ruteName) {
        this.ruteName = ruteName;
    }

    public String getPhamTypeCode1() {
        return phamTypeCode1;
    }

    public void setPhamTypeCode1(String phamTypeCode1) {
        this.phamTypeCode1 = phamTypeCode1;
    }

    public String getPhamTypeCode2() {
        return phamTypeCode2;
    }

    public void setPhamTypeCode2(String phamTypeCode2) {
        this.phamTypeCode2 = phamTypeCode2;
    }

    public String getPhamTypeCode3() {
        return phamTypeCode3;
    }

    public void setPhamTypeCode3(String phamTypeCode3) {
        this.phamTypeCode3 = phamTypeCode3;
    }

    public String getPhamTypeCode4() {
        return phamTypeCode4;
    }

    public void setPhamTypeCode4(String phamTypeCode4) {
        this.phamTypeCode4 = phamTypeCode4;
    }

    public String getPhamTypeName1() {
        return phamTypeName1;
    }

    public void setPhamTypeName1(String phamTypeName1) {
        this.phamTypeName1 = phamTypeName1;
    }

    public String getPhamTypeName2() {
        return phamTypeName2;
    }

    public void setPhamTypeName2(String phamTypeName2) {
        this.phamTypeName2 = phamTypeName2;
    }

    public String getPhamTypeName3() {
        return phamTypeName3;
    }

    public void setPhamTypeName3(String phamTypeName3) {
        this.phamTypeName3 = phamTypeName3;
    }

    public String getPhamTypeName4() {
        return phamTypeName4;
    }

    public void setPhamTypeName4(String phamTypeName4) {
        this.phamTypeName4 = phamTypeName4;
    }

    public String getSpecName() {
        return specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    public String getProdentpCode() {
        return prodentpCode;
    }

    public void setProdentpCode(String prodentpCode) {
        this.prodentpCode = prodentpCode;
    }

    public String getProdentpName() {
        return prodentpName;
    }

    public void setProdentpName(String prodentpName) {
        this.prodentpName = prodentpName;
    }

    public String getPrxyEntpCode() {
        return prxyEntpCode;
    }

    public void setPrxyEntpCode(String prxyEntpCode) {
        this.prxyEntpCode = prxyEntpCode;
    }

    public String getPrxyEntpName() {
        return prxyEntpName;
    }

    public void setPrxyEntpName(String prxyEntpName) {
        this.prxyEntpName = prxyEntpName;
    }

    public String getPac() {
        return pac;
    }

    public void setPac(String pac) {
        this.pac = pac;
    }

    public String getPacmatlName() {
        return pacmatlName;
    }

    public void setPacmatlName(String pacmatlName) {
        this.pacmatlName = pacmatlName;
    }

    public String getProdTypeName() {
        return prodTypeName;
    }

    public void setProdTypeName(String prodTypeName) {
        this.prodTypeName = prodTypeName;
    }

    public String getProdSoucCode() {
        return prodSoucCode;
    }

    public void setProdSoucCode(String prodSoucCode) {
        this.prodSoucCode = prodSoucCode;
    }

    public String getProdSoucName() {
        return prodSoucName;
    }

    public void setProdSoucName(String prodSoucName) {
        this.prodSoucName = prodSoucName;
    }

    public String getAprvno() {
        return aprvno;
    }

    public void setAprvno(String aprvno) {
        this.aprvno = aprvno;
    }

    public String getRegcertno() {
        return regcertno;
    }

    public void setRegcertno(String regcertno) {
        this.regcertno = regcertno;
    }

    public BigDecimal getDayuse() {
        return dayuse;
    }

    public void setDayuse(BigDecimal dayuse) {
        this.dayuse = dayuse;
    }

    public String getEssdrugFlag() {
        return essdrugFlag;
    }

    public void setEssdrugFlag(String essdrugFlag) {
        this.essdrugFlag = essdrugFlag;
    }

    public Date getOptTime() {
        return optTime;
    }

    public void setOptTime(Date optTime) {
        this.optTime = optTime;
    }

    public String getBklsFlag() {
        return bklsFlag;
    }

    public void setBklsFlag(String bklsFlag) {
        this.bklsFlag = bklsFlag;
    }

    public String getHiType() {
        return hiType;
    }

    public void setHiType(String hiType) {
        this.hiType = hiType;
    }
}
